package tests.user;

import tester.*;

/**
 * Copyright 2007, 2008 Viera K. Proulx
 * This program is distributed under the terms of the 
 * GNU Lesser General Public License (LGPL)
 */

/*
    +-------------+
    | Author      |
    +-------------+
    | String name | 
    | int    age  |
    +-------------+  
 */  

/**
 * A class to represent a book with an author.
 * An example of a class with object containment.
 * 
 * @author Viera K. Proulx
 * @since 30 May 2007
 */
public class Author implements ISame<Author>{
  /** author's name */
  public String name;
  /** author's age */
  public int    age;

  /**
   * The standard full constructor
   * @param name the author's name
   * @param age the author's age
   */
  public Author(String name, int age){
    this.name=name;
    this.age=age;
  }
  
  /**
   * Implement the <CODE>{@link ISame ISame}</CODE> interface differently 
   * from the one provided by the test harness -- to test the correct dispatch
   * of the test harness
   */
  public boolean same(Author that){
    return this.name.equals(that.name);
  }
  
  /**
   * Override the toString method to test the printing feature
   * @return a String representation of this author
   */
  /*
  public String toString(){
  	return "Author name: " + this.name + 
  	       ", age: " + this.age;
  }
  */
}         


